package luanvan.app.foodnote.library;

public class Food implements Comparable<Food> {
	 
	private String id;
	private String type_food_id;
	private String place_name;
	private String food_name;
	private String address;
	private String district;
	private String city;
	private String discription;
	private double latitude;
	private double longitude;
	
	public static int action;
	
	public Food(){}
	public Food(String id, String type_food_id, String place_name, String food_name){
		this.id = id;
		this.type_food_id = type_food_id;
		this.place_name = place_name;
		this.food_name = food_name;
	}
	
	public Food(String id, String type_food_id, String place_name, String food_name, String address,
			String district, String city, double latitude, double longitude){
		this.id = id;
		this.type_food_id = type_food_id;
		this.place_name = place_name;
		this.food_name = food_name;
		this.address = address;
		this.district = district;
		this.city = city;
		this.latitude = latitude;
		this.longitude = longitude;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	public String getType_food_id() {
		return type_food_id;
	}

	public void setType_food_id(String type_food_id) {
		this.type_food_id = type_food_id;
	}
	
	public String getPlace_name() {
		return place_name;
	}
	public void setPlace_name(String place_name) {
		this.place_name = place_name;
	}
	
	public String getFood_name() {
		return food_name;
	}
	public void setFood_name(String food_name) {
		this.food_name = food_name;
	}
	
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getDistrict() {
		return district;
	}
	public void setDistrict(String district) {
		this.district = district;
	}
	
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	
	public String getDiscription() {
		return discription;
	}
	public void setDiscription(String discription) {
		this.discription = discription;
	}
	
	public double getLatitude() {
		return latitude;
	}
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	
	@Override
	public String toString(){
		return "Food [id=" + id + ", type_food_id=" + type_food_id + ", place_name=" + place_name + 
				", food_name=" + food_name + ", address=" + address + ", district=" + district + 
				", city=" + city + ", latitude=" + latitude + ", longitude=" + longitude + "]";
	}

	@Override
	public int compareTo(Food another) {
		// TODO Auto-generated method stub
		if(Food.action == 1)
			return this.getCity().compareTo(another.getCity());
		if (Food.action == 2)
			return this.getDistrict().compareTo(another.getDistrict());
		return 0;
	}
}
